package com.sg.service.base.app.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sg.common.util.CommonFunctionHelper;
import com.sg.dto.base.app.req.*;
import com.sg.entity.OmsEvaBatchRelatedSet;
import com.sg.service.base.app.MOmsEvaBatchRelatedSetService;
import com.wicket.okrapp.common.annotations.BanAuto;
import com.wicket.okrapp.common.dto.FieldInfo;
import com.wicket.okrapp.common.exception.BizException;
import com.wicket.okrapp.dal.mapper.mbg.OmsEvaBatchRelatedSetMapper;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author ：
 * @version 1.0
 * @since 2022/1/19 15:39
 */
@Service
public class MOmsEvaBatchRelatedSetServiceImpl
        extends ServiceImpl<OmsEvaBatchRelatedSetMapper, OmsEvaBatchRelatedSet>
        implements MOmsEvaBatchRelatedSetService {

    @Autowired
    OmsEvaBatchRelatedSetMapper omsEvaBatchRelatedSetMapper;

    /**
     * 3-3-09-03批量查部门目标任务书设置[2665]
     * gen by moon at 10/15/2022, 10:04:59 PM
     */
    @Trace(operationName = "3-3-09-03批量查部门目标任务书设置")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsEvaBatchRelatedSet> batchQueryDepObjMisStaSet(BatchQueryDepObjMisStaSetReq reqDto) {

        try {
            QueryWrapper<OmsEvaBatchRelatedSet> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            if (reqDto.getBatchRelatedSetList() == null || reqDto.getBatchRelatedSetList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("batch_set_id", reqDto.getBatchRelatedSetList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsEvaBatchRelatedSet.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsEvaBatchRelatedSet.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsEvaBatchRelatedSet.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsEvaBatchRelatedSet>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-09-03批量改部门目标任务书设置[2666]
     * gen by moon at 10/15/2022, 10:05:00 PM
     */
    @Trace(operationName = "3-3-09-03批量改部门目标任务书设置")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchUpdateDeptTargetTaskSet(List<OmsEvaBatchRelatedSet> omsEvaBatchRelatedSet) {

        if (omsEvaBatchRelatedSet == null || omsEvaBatchRelatedSet.size() == 0) {
            return false;
        }
        return super.saveOrUpdateBatch(omsEvaBatchRelatedSet);

    }

    /**
     * 3-3-09-03批量增评价模板批次设置[2959]
     * gen by moon at 10/15/2022, 10:05:00 PM
     */
    @Trace(operationName = "3-3-09-03批量增评价模板批次设置")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchAddPlanEvaBatchSet(List<OmsEvaBatchRelatedSet> omsEvaBatchRelatedSet) {

        if (omsEvaBatchRelatedSet == null || omsEvaBatchRelatedSet.size() == 0) {
            return false;
        }

        return super.saveBatch(omsEvaBatchRelatedSet.stream().map(item -> {
            item.setBatchRelatedSetId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
            item.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setIsValid("FALSE");
            item.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            item.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            return item;
        }).collect(Collectors.toList()));
    }

    /**
     * 3-3-09-03查询评价模板批次设置列表[2978]
     * gen by moon at 10/15/2022, 10:05:01 PM
     */
    @Trace(operationName = "3-3-09-03查询评价模板批次设置列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsEvaBatchRelatedSet> queryPlanEvaBatchSetList(QueryPlanEvaBatchSetListReq reqDto) {

        try {
            QueryWrapper<OmsEvaBatchRelatedSet> queryWrapper = new QueryWrapper<>();


            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsEvaBatchRelatedSet.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsEvaBatchRelatedSet.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsEvaBatchRelatedSet.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsEvaBatchRelatedSet>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-09-03查询评价模板批次设置详情[2998]
     * gen by moon at 3/30/2023, 12:39:19 PM
     */
    @Trace(operationName = "3-3-09-03查询评价模板批次设置详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsEvaBatchRelatedSet queryPlanEvaBatchSetDetail(QueryPlanEvaBatchSetDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            QueryWrapper<OmsEvaBatchRelatedSet> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsEvaBatchRelatedSet> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsEvaBatchRelatedSet retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-09-03批量查询评价模板批次设置[3017]
     * gen by moon at 10/15/2022, 10:05:03 PM
     */
    @Trace(operationName = "3-3-09-03批量查询评价模板批次设置")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsEvaBatchRelatedSet> batchQueryPlanEvaBatchSet(BatchQueryPlanEvaBatchSetReq reqDto) {

        try {
            QueryWrapper<OmsEvaBatchRelatedSet> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            if (reqDto.getBatchRelatedSetList() == null || reqDto.getBatchRelatedSetList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("batch_set_id", reqDto.getBatchRelatedSetList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsEvaBatchRelatedSet.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsEvaBatchRelatedSet.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsEvaBatchRelatedSet.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsEvaBatchRelatedSet>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-09-03批量改评价模板批次设置[3018]
     * gen by moon at 10/15/2022, 10:05:04 PM
     */
    @Trace(operationName = "3-3-09-03批量改评价模板批次设置")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchUpdatePlanEvaBatchSet(List<OmsEvaBatchRelatedSet> omsEvaBatchRelatedSet) {

        if (omsEvaBatchRelatedSet == null || omsEvaBatchRelatedSet.size() == 0) {
            return false;
        }
        return super.saveOrUpdateBatch(omsEvaBatchRelatedSet);

    }

    /**
     * 3-3-09-03修改评价模板批次设置[3034]
     * gen by moon at 5/11/2023, 5:26:45 PM
     */
    @Trace(operationName = "3-3-09-03修改评价模板批次设置")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    @BanAuto
    public boolean updatePlanEvaBatchSet(OmsEvaBatchRelatedSet omsEvaBatchRelatedSet) {
//     UpdateWrapper<OmsEvaBatchRelatedSet> uw = new UpdateWrapper<>();
//        uw.eq("batch_related_set_id",omsEvaBatchRelatedSet.getBatchRelatedSetId());
//        uw.setSql("update_task_or_tree_progress = update_task_or_tree_progress + " + omsEvaBatchRelatedSet.getUpdateTaskOrTreeProgress());//ADD_NUMERICAL
//        omsEvaBatchRelatedSet.setUpdateTaskOrTreeProgress(null);
//        super.update(omsEvaBatchRelatedSet,uw);
        return super.updateById(omsEvaBatchRelatedSet);
    }

    /**
     * 3-3-09-03新增评价模板批次设置[3285]
     * gen by moon at 4/26/2023, 11:39:28 PM
     */
    @Trace(operationName = "3-3-09-03新增评价模板批次设置")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addPlanEvaBatchSet(OmsEvaBatchRelatedSet omsEvaBatchRelatedSet) {
        omsEvaBatchRelatedSet.setBatchRelatedSetId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsEvaBatchRelatedSet.setObjectiveDistributeProgress(Long.valueOf(-1));//CUSTOM_CONVENTION
        omsEvaBatchRelatedSet.setObjectiveDistributeDone("FALSE");
        omsEvaBatchRelatedSet.setSetCompleteStatus("FALSE");
        omsEvaBatchRelatedSet.setBatchProcessProgress(Long.valueOf(-1));//CUSTOM_CONVENTION
        omsEvaBatchRelatedSet.setDelBatchIsDone("FALSE");
        omsEvaBatchRelatedSet.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsEvaBatchRelatedSet.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsEvaBatchRelatedSet.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsEvaBatchRelatedSet.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsEvaBatchRelatedSet.setIsValid("FALSE");
        omsEvaBatchRelatedSet.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsEvaBatchRelatedSet.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        if (super.save(omsEvaBatchRelatedSet)) {
            return omsEvaBatchRelatedSet.getBatchRelatedSetId();
        } else {
            return "-1";
        }

    }

    /**
     * 3-3-09批量删评价模板批次设置[3908]
     * gen by moon at 10/15/2022, 10:05:06 PM
     */
    @Trace(operationName = "3-3-09批量删评价模板批次设置")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchDeletePlanEvaBatchSet(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

    /**
     * M3-3-09-03修改评价模板批次相关设置标准数据[4286]
     * gen by moon at 10/15/2022, 10:05:08 PM
     */
    @Trace(operationName = "M3-3-09-03修改评价模板批次相关设置标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateEvaTempRelatedSet(OmsEvaBatchRelatedSet omsEvaBatchRelatedSet) {

        return super.updateById(omsEvaBatchRelatedSet);
    }

    /**
     * M-构造评价模板批次相关设置标准数据验证数据[4257]
     * gen by moon at 10/15/2022, 10:05:07 PM
     */
    @Trace(operationName = "M-构造评价模板批次相关设置标准数据验证数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String buildEvaTempRelatedSet(OmsEvaBatchRelatedSet omsEvaBatchRelatedSet) {
        omsEvaBatchRelatedSet.setBatchRelatedSetId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsEvaBatchRelatedSet.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsEvaBatchRelatedSet.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsEvaBatchRelatedSet.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsEvaBatchRelatedSet.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsEvaBatchRelatedSet.setIsValid("FALSE");
        omsEvaBatchRelatedSet.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsEvaBatchRelatedSet.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        if (super.save(omsEvaBatchRelatedSet)) {
            return omsEvaBatchRelatedSet.getBatchRelatedSetId();
        } else {
            return "-1";
        }

    }

    /**
     * 3-3-09-03重置单条业务应用批次相关设置[4390]
     * gen by moon at 10/15/2022, 10:05:09 PM
     */
    @Trace(operationName = "3-3-09-03重置单条业务应用批次相关设置")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean resetSingleAppBatchRelatedSet(OmsEvaBatchRelatedSet omsEvaBatchRelatedSet) {

        return super.updateById(omsEvaBatchRelatedSet);
    }

    /**
     * 3-3-09-03查询单条业务应用批次相关设置详情[4391]
     * gen by moon at 3/30/2023, 12:39:19 PM
     */
    @Trace(operationName = "3-3-09-03查询单条业务应用批次相关设置详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsEvaBatchRelatedSet querySingleAppBatchRelatedSetDetail(QuerySingleAppBatchRelatedSetDetailReq reqDto) {

        try {

            QueryWrapper<OmsEvaBatchRelatedSet> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsEvaBatchRelatedSet> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsEvaBatchRelatedSet retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M3执行业务应用公共字段推送内存（特殊方法）[4520]
     * gen by moon at 10/15/2022, 10:05:10 PM
     */
    @Trace(operationName = "M3执行业务应用公共字段推送内存（特殊方法）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsEvaBatchRelatedSet implementBizPublicFieldPushMemory() {
        return null; //todo ruizhe dong
    }

    /**
     * 3-3-09-03执行悬停查批次相关设置（悬停）[4526]
     * gen by moon at 9/12/2022, 1:20:44 PM
     */
    @Trace(operationName = "3-3-09-03执行悬停查批次相关设置（悬停）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @BanAuto
    public List<OmsEvaBatchRelatedSet> implementSpinLockCheckPlanEvaBatchSet(ImplementSpinLockCheckPlanEvaBatchSetReq reqDto) {
        try {
            long count = 500;
            while (true) {
                if (count == 0) {
                    break;
                }
                reqDto.setIsValid("FALSE");
                QueryWrapper<OmsEvaBatchRelatedSet> queryWrapper = new QueryWrapper<>();
                Map<String, Object> fieldInfoMap = null;
                fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
                CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
                queryWrapper.orderByDesc("create_time");
                if (super.list(queryWrapper) != null && super.list(queryWrapper).size() > 0) {
                    List<OmsEvaBatchRelatedSet> retData = new ArrayList<>();
                    retData.add(super.list(queryWrapper).get(0));
                    return retData;
                }
                count--;
                Thread.sleep(10);
            }
            throw new BizException("-1", false);
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-09-03删除评价模板批次设置[4610]
     * gen by moon at 10/15/2022, 10:05:11 PM
     */
    @Trace(operationName = "3-3-09-03删除评价模板批次设置")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean deletePlanEvaBatchSet(String batchRelatedSetId) {

        return super.removeById(batchRelatedSetId);
    }

    /**
     * 3-3-09-03修改更新任务或树处理进度[6682]
     * gen by moon at 5/14/2023, 3:27:16 PM
     */
    @Trace(operationName = "3-3-09-03修改更新任务或树处理进度")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    @BanAuto
    public boolean updateUpdateTaskOrTreeProgress(OmsEvaBatchRelatedSet omsEvaBatchRelatedSet) {
        UpdateWrapper<OmsEvaBatchRelatedSet> uw = new UpdateWrapper<>();
        uw.eq("batch_related_set_id", omsEvaBatchRelatedSet.getBatchRelatedSetId());
        uw.setSql("update_task_or_tree_progress = update_task_or_tree_progress + " + omsEvaBatchRelatedSet.getUpdateTaskOrTreeProgress());//ADD_NUMERICAL
        omsEvaBatchRelatedSet.setUpdateTaskOrTreeProgress(null);
        super.update(omsEvaBatchRelatedSet, uw);
        return super.updateById(omsEvaBatchRelatedSet);
    }

}

